import axios from '../WuJiUtils/http'

const getNumber = async (_data: {
    limit: number,
    page: number,
    name?: string,
    nickname?: string,
    phone?: string,
    vipcard?: string,
}) => {
    const data = await axios({
        url: '/vipUser/list',
        method: 'post',
        params: _data
    })
    return data
}
const getNumberinfo = async (_data: {
    id: number
    name?:string
    nickname?:string
    phone?:string
    vipcard?:string
}) => {
    const data = await axios({
        url: '/vipUser/base',
        method: 'get',
        params: _data
    })
    return data
}
const getnumberinfodetail = async (_data: {
    id: number
}) => {
    const data = await axios({
        url: `/vipUser/info/${_data.id}`,
        method: 'get',
        params: _data
    })
    return data
}
const gettradeinfo = async (_data: {
}) => {
    const data = await axios({
        url: '/vipRecharge/findByQueryDto',
        method: 'post',
        data: _data
    })
    return data
}
const editnmberinfo =async(_data:{
    id:number
    birthday:string
    phone:string
    sex:string
    name:string
})=>{
    const data =await axios({
        url:'/vipUser/updateBase',
        method:'post',
        data:_data
    })
    return data
}
const getnumberjifen =async(_data:{
    vipId:number
})=>{
    const data=await axios({
        url:'/vipIntrgral/findByVipId',
        method:'get',
        params:_data
    })
    return data
}

const getchongzhiinfo =async(_data:{
    page:number,
    limit:number,
    startTime?:'string',
    endTime?:'string',
    rechargeType?:'string',
    number?:number,
    name?:'string'
    nickname?:'string'
    phone?:'string'
    vipcard?:'string'

})=>{
    const data = await axios({
        url:'/vipRecharge/findByQueryDto',
        method:'post',
        params:_data
    })
    return data
}
const editjifen =async(_data:{
    
        alterIntegral: number,
        remark: string,
        vipId: number
      
})=>{
    const data = await axios({
        url:'/vipIntrgral/updateIntegralByDto',
        method:'post',
        data:_data
    })
    return data
}
export { getNumber, getNumberinfo, getnumberinfodetail, gettradeinfo,editnmberinfo,getnumberjifen,getchongzhiinfo,editjifen}